#define _CRT_SECURE_NO_WARNINGS
#include"string.h"
namespace bit
{
	void test_string8()
	{
		string s1("Test.cpp");
		/*FILE* fout = fopen(s1.c_str(), "r");
		char ch = fgetc(fout);
		while (ch != EOF)
		{
			cout << ch;
			ch = fgetc(fout);
		}*/

		/*	string ret;
			string s2("Test.cpp.tar.zip");
			size_t pos = s2.rfind('.');
			if (pos != string::npos)
			{
				ret = s2.substr(pos);
			}
			cout << ret << endl;*/

		string url("https://legacy.cplusplus.com/reference/string/string/find/");
		size_t pos1 = url.find(':');
		if (pos1 != string::npos)
		{
			string sub1 = url.substr(0, pos1);
			std::cout << sub1.c_str() << std::endl;
		}

		size_t pos2 = url.find('/', pos1 + 3);
		if (pos2 != string::npos)
		{
			string sub2 = url.substr(pos1 + 3, pos2 - (pos1 + 3));
			std::cout << sub2.c_str() << std::endl;

			string sub3 = url.substr(pos2 + 1);
			std::cout << sub3.c_str() << std::endl;
		}
	}
}
	int main()
	{
		bit::test_string8();

		/*std::string s1("hello wrold");
		s1.resize(20);
		s1 += '#';*/


		return 0;
	}